<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
		<script src="js/inidex.js" type="text/javascript" charset="utf-8"></script>
		<title>首页</title>
	</head>
	<body>
		<!--主页内容显示-->
		<div class="middle">
			<?php while($arraylist=$stmtlist->fetch()){ ?>
			<div class="mul">
				<div class="m m1">
					<?php 
						echo $arraylist['uid']."&nbsp;&nbsp;&nbsp;发表了日志:&nbsp;&nbsp;".$arraylist['title'];
					 ?>
				</div>
				<div class="m m2">
					<?php 
						$content =  $arraylist['content'];
						$arrcnt = explode("||", $content);
						echo "<ul>";
						
						foreach($arrcnt as $k=>$v){
							if($uid == $arraylist['uid']){
								echo "<li contenteditable='true'>". $v ."</li>";
							}else{
								echo "<li>". $v ."</li>";
							}
						}
						echo "</ul>";
					?>
				</div>
				<div class="m m3">
					<?php 
						echo '发表时间:'.date('Y-m-d h:i:s',$arraylist['utime']);
						//如果是自己的则可删除
						if($uid == $arraylist['uid']){
							echo "<a href='javascript:void(0)' onclick = 'editList(this,".$arraylist['id'].");'>[修改]</a> | <a href='javascript:void(0)' onclick='delList(this,".$arraylist['id'].");'>[删除]</a>";
						}
					?>
				</div>
			</div>
			<?php } ?>
		</div>
		<div>
			<?php
                if ($total > $showrow) {//总记录数大于每页显示数，显示分页
                    $page = new page($total, $showrow, $curpage, $url, 2);
                    echo $page->myde_write();
                }
            ?>
		</div>
		<!-- 原登陆页-->
	</body>

</html>
<!--导入底部页面 -->
<?php
include_once "bottom.html"
?>